//
//  ApiClient.h
//  weappios
//
//  Created by chensentao on 2018/8/3.
//  Copyright © 2018年 XiGuangLu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define API_ROOT @"https://weapp.whwangdoudou.cn"

#define appVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

#ifdef DEBUG

#define FILE_NAME @"/b"

#define kCHANNEL @"bbz"

#define kVer @"1213"

#define URL_WEB [NSString stringWithFormat:@"%@%@/quiescent/index/index.html",API_ROOT,FILE_NAME]

#else

#define FILE_NAME @"/b"

#define kCHANNEL @"bbz"

#define kVer @"1213"

#define URL_WEB [NSString stringWithFormat:@"%@%@/quiescent/index/index_pac_%@.html",API_ROOT,FILE_NAME,appVersion]

#endif

#define URL_LOGIN [[API_ROOT stringByAppendingString:FILE_NAME] stringByAppendingString:@"/login.html"]

#define API_URL [API_ROOT stringByAppendingString:@"/weapp.php"]

#define API_SHARE  [API_ROOT stringByAppendingString:@"/article.php"]

#define API_PAYURL [API_ROOT stringByAppendingString:@"/weapp.php"]

//#define API_ZHUSHOU @"https://www.wanzhuanke.com"

#define weixin @"https://apps.apple.com/cn/app/%E5%BE%AE%E4%BF%A1/id414478124"

#define MODULE_PERSONAL    @"personal"
#define MODULE_SEND_CODE   @"send_code"
#define MODULE_CHECK_CODE  @"check_code"
#define MODULE_IOS_CHECK_CODE  @"ios_check_code"
#define MODULE_JUMP_REWARD @"jump_reward"
#define MODULE_PLAY        @"play"
#define MODULE_STEP        @"step"
#define MODULE_GETUI_CID  @"getui_cid"
#define MODULE_jumpAuth    @"jumpAuth"
#define MODULE_share       @"get_share_info"
#define MODULE_pay         @"jump_pay"

//定义回调接口
typedef void(^CallbackResult)(NSDictionary *data, NSError *connectionError);

@interface ApiClient : NSObject

+(ApiClient*)sharedApi;

-(void)personal:(NSDictionary*)dict cb:(CallbackResult)callback;
-(void)send_code:(NSDictionary*)dict cb:(CallbackResult)callback;
-(void)check_code:(NSDictionary*)dict cb:(CallbackResult)callback;
-(void)ios_check_code:(NSDictionary*)dict cb:(CallbackResult)callback;
-(void)jump_reward:(NSDictionary*)dict cb:(CallbackResult)callback;
-(void)play:(NSDictionary*)dict cb:(CallbackResult)callback;
-(void)step:(CallbackResult)callback;
- (void)getui_cid:(NSDictionary*)dict cd:(CallbackResult)callback;
-(void)jumpAuth:(NSDictionary *)dict cb:(CallbackResult)callback;
-(void)share:(NSDictionary *)dict cb:(CallbackResult)callback;
-(void)pay:(NSDictionary *)dict cb:(CallbackResult)callback;
    
- (void)yiqishike_userp:(NSDictionary *)dict cb:(CallbackResult)callback;
- (void)yiqishike_send_active:(NSDictionary *)dict cb:(CallbackResult)callback;
- (void)yiqishike_logd:(NSDictionary *)dict cb:(CallbackResult)callback;
- (void)yiqishike_phone:(NSDictionary *)dict cb:(CallbackResult)callback;

- (void)getSchemescb:(CallbackResult)callback;
- (void)getChannelcb:(CallbackResult)callback;
- (void)postRewardParameters:(NSDictionary *)param cb:(CallbackResult)callback;
    
@end
